import { createRouter, createWebHistory } from 'vue-router'
import Login from '../views/login.vue'
import Home from '../views/home.vue'
/**
 * 用户管理
 */
import User from  '../views/user/user_list.vue'
/**
 * 订单管理
 */
import ApplyList from '../views/order/apply_list.vue'
import OrderList from '../views/order/order_list.vue'
import CheckOrder from '../views/order/check_order.vue'
/**
 * 供应商管理
 */
import RegisterSuppLier from '../views/supplier/register_supplier.vue'
import SupplierList from '../views/supplier/supplier_list.vue'
/**
 * 财务管理
 */
import OrderPay from '../views/finance/order_pay.vue'
import FinanceList from '../views/finance/finance_list.vue'

/**
 * 仓库管理
 */
import WarehouseList from '../views/warehouse/warehouse_list.vue'
import OrderState from '../views/warehouse/order_state.vue'

/**
 * 注册页面-只限供应商注册
 */
import Register from '../components/register.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
		path: '/',
		name: 'Login',
		component: Login
    },
	{
		path:'/register',
		name:'Register',
		component:Register
	},
	{
		path:'/home',
		name:'Home',
		component:Home,
		children:[
			{
				path:'/user_list',
				name:'User',
				component:User
			},{
				path:'/apply_list',
				name:'ApplyList',
				component:ApplyList
			},{
				path:'/order_list',
				name:'OrderList',
				component:OrderList
			},{
				path:'/check_order',
				name:'CheckOrder',
				component:CheckOrder
			},{
				path:'/register_supplier',
				name:'RegisterSuppLier',
				component:RegisterSuppLier
			},{
				path:'/supplier_list',
				name:'SupplierList',
				component:SupplierList
			},{
				path:'/order_pay',
				name:'OrderPay',
				component:OrderPay
			},{
				path:'/finance_list',
				name:'FinanceList',
				component:FinanceList
			},{
				path:'/warehouse_list',
				name:'WarehouseList',
				component:WarehouseList
			},{
				path:'/order_state',
				name:'OrderState',
				component:OrderState
			}
		]
	}
  ]
})

export default router
